package com.kgc.xsConsumer.controller;

import com.kgc.basic.util.ResponseMsg;
import com.kgc.xsConsumer.feign.SalesOutFeign;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/salesOut")
@CrossOrigin
public class SalesOutController {

    private Logger logger = LoggerFactory.getLogger(getClass());

    @Autowired
    private SalesOutFeign  salesOutFeign;


    @RequestMapping("/selectSalesOutByPage")
    public ResponseMsg selectSalesOutByPage(@RequestBody Map<String,Object> map){
        logger.info("SalesOutController selectSalesOutByPage params {}",map.toString());
        ResponseMsg responseMsg = salesOutFeign.selectSalesOutByPage(map);
        logger.debug("SalesOutController selectSalesOutByPage responseMsg {}",responseMsg.toString());
        return responseMsg;
    }

    @RequestMapping("/selectSalesOutDetail")
    public ResponseMsg selectSalesOutDetail(@RequestBody Map<String,Object> map){
        logger.info("SalesOutController selectSalesOutDetail params {}",map.toString());
        ResponseMsg responseMsg=salesOutFeign.selectSalesOutDetailByPage(map);
        logger.debug("SalesOutController selectSalesOutDetail responseMsg {}",responseMsg.toString());
        return responseMsg;
    }


}
